BX.namespace("BX.UI");if(typeof BX.UI.EditorDragScope==="undefined"){BX.UI.EditorDragScope={intermediate:0,parent:1,form:2,getDefault:function(){return this.form}}}if(typeof BX.UI.EditorDragObjectType==="undefined"){BX.UI.EditorDragObjectType={intermediate:"",field:"F",section:"S"}}if(typeof BX.UI.BaseDragController==="undefined"){BX.UI.BaseDragController=function(){this._id="";this._settings={};this._node=null;this._ghostNode=null;this._ghostOffset={x:0,y:0};this._previousPos=null;this._currentPos=null;this._enableDrag=true;this._isInDragMode=false;this._preserveDocument=false;this._bodyOverflow=""};BX.UI.BaseDragController.prototype={initialize:function(t,e){if(typeof jsDD==="undefined"){throw"UI.CustomDragItem: Could not find jsDD API."}this._id=BX.type.isNotEmptyString(t)?t:BX.util.getRandomString(8);this._settings=e?e:{};this._node=this.getSetting("node");if(!this._node){throw"UI.CustomDragItem: The 'node' parameter is not defined in settings or empty."}this._enableDrag=this.getSetting("enableDrag",true);this._ghostOffset=this.getSetting("ghostOffset",{x:0,y:0});this.doInitialize();this.bindEvents()},doInitialize:function(){},release:function(){this.doRelease();this.unbindEvents()},doRelease:function(){},getId:function(){return this._id},getSetting:function(t,e){return this._settings.hasOwnProperty(t)?this._settings[t]:e},bindEvents:function(){this._node.onbxdragstart=BX.delegate(this._onDragStart,this);this._node.onbxdrag=BX.delegate(this._onDrag,this);this._node.onbxdragstop=BX.delegate(this._onDragStop,this);this._node.onbxdragrelease=BX.delegate(this._onDragRelease,this);jsDD.registerObject(this._node);this.doBindEvents()},doBindEvents:function(){},unbindEvents:function(){delete this._node.onbxdragstart;delete this._node.onbxdrag;delete this._node.onbxdragstop;delete this._node.onbxdragrelease;if(BX.type.isFunction(jsDD.unregisterObject)){jsDD.unregisterObject(this._node)}this.doUnbindEvents()},doUnbindEvents:function(){},createGhostNode:function(){throw"UI.CustomDragItem: The 'createGhostNode' function is not implemented."},getGhostNode:function(){return this._ghostNode},removeGhostNode:function(){throw"UI.CustomDragItem: The 'removeGhostNode' function is not implemented."},processDragStart:function(){},processDragPositionChange:function(t){},processDrag:function(t,e){},processDragStop:function(){},addDragListener:function(t){BX.Event.EventEmitter.subscribe("BX.UI.BaseDragController:drag",t)},removeDragListener:function(t){BX.Event.EventEmitter.unsubscribe("BX.UI.BaseDragController:drag",t)},getContextId:function(){return""},getContextData:function(){return{}},getScrollTop:function(){var t=document.documentElement;var e=document.body;var r=t.scrollTop||e&&e.scrollTop||0;r-=t.clientTop;return r},getScrollHeight:function(){var t=document.documentElement;var e=document.body;return t.scrollHeight||e&&e.scrollHeight||0},isDragDropBinEnabled:function(){return true},_onDragStart:function(){if(!this._enableDrag){return}this.createGhostNode();var t=BX.pos(this._node);this._ghostNode.style.top=t.top+"px";this._ghostNode.style.left=t.left+"px";this._currentPos=this._previousPos=null;this._isInDragMode=true;BX.UI.BaseDragController.currentDragged=this;this.processDragStart();window.setTimeout(BX.delegate(this._prepareDocument,this),0)},_onDrag:function(t,e){if(!this._isInDragMode){return}var r={x:t,y:e};this.processDragPositionChange(r);if(this._ghostNode){this._ghostNode.style.top=r.y+this._ghostOffset.y+"px";this._ghostNode.style.left=r.x+this._ghostOffset.x+"px"}this._currentPos=r;if(!this._previousPos){this._previousPos=r}this._scrollIfNeed();this.processDrag(r.x,r.y);BX.Event.EventEmitter.emit("BX.UI.BaseDragController:drag",{item:this,x:r.x,y:r.y});this._previousPos=this._currentPos},_onDragStop:function(t,e){if(!this._isInDragMode){return}this.removeGhostNode();this._isInDragMode=false;if(BX.UI.BaseDragController.currentDragged===this){BX.UI.BaseDragController.currentDragged=null}this._currentPos=this._previousPos=null;this.processDragStop();window.setTimeout(BX.delegate(this._resetDocument,this),0)},_onDragRelease:function(t,e){},_prepareDocument:function(){if(!this._preserveDocument){this._bodyOverflow=document.body.style.overflow;document.body.style.overflow="hidden"}},_resetDocument:function(){if(!this._preserveDocument){document.body.style.overflow=this._bodyOverflow}},_scrollIfNeed:function(){if(!this._ghostNode){return}var t=window.document.documentElement;var e=t.clientTop;var r=t.clientTop+t.clientHeight;var o=this.getScrollHeight();var i=this._currentPos.y-this._previousPos.y;if(i===0){return}var n=-1;for(;;){var s=this.getScrollTop();var a=this._ghostNode.getBoundingClientRect();if(i>0&&(a.bottom>r||r-a.bottom<64)){if(s>=o||n===s){break}n=s;s+=1;window.scrollTo(0,s<o?s:o)}else if(i<0&&(e>a.top||a.top-e<64)){if(s<=0||n===s){break}n=s;s-=1;window.scrollTo(0,s>0?s:0)}else{break}}}};BX.UI.BaseDragController.currentDragged=null;BX.UI.BaseDragController.emulateDrag=function(){jsDD.refreshDestArea();if(jsDD.current_node){jsDD.drag({clientX:jsDD.x-jsDD.wndSize.scrollLeft,clientY:jsDD.y-jsDD.wndSize.scrollTop})}}}if(typeof BX.UI.BaseDropController==="undefined"){BX.UI.BaseDropController=function(){this._id="";this._settings={};this._node=null;this._itemDragHandler=BX.delegate(this._onItemDrag,this);this._draggedItem=null;this._enabled=true};BX.UI.BaseDropController.prototype={initialize:function(t,e){if(typeof jsDD==="undefined"){throw"BX.UI.BaseDropController: Could not find jsDD API."}this._id=BX.type.isNotEmptyString(t)?t:BX.util.getRandomString(8);this._settings=e?e:{};this._node=this.getSetting("node");if(!this._node){throw"BX.UI.BaseDropController: The 'node' parameter is not defined in settings or empty."}this.doInitialize();this.bindEvents()},doInitialize:function(){},release:function(){this.doRelease();this.unbindEvents()},doRelease:function(){},getId:function(){return this._id},getSetting:function(t,e){return this._settings.hasOwnProperty(t)?this._settings[t]:e},bindEvents:function(){this._node.onbxdestdraghover=BX.delegate(this._onDragOver,this);this._node.onbxdestdraghout=BX.delegate(this._onDragOut,this);this._node.onbxdestdragfinish=BX.delegate(this._onDragFinish,this);this._node.onbxdragstop=BX.delegate(this._onDragStop,this);this._node.onbxdragrelease=BX.delegate(this._onDragRelease,this);jsDD.registerDest(this._node,this.getPriority());this.doBindEvents()},doBindEvents:function(){},unbindEvents:function(){delete this._node.onbxdestdraghover;delete this._node.onbxdestdraghout;delete this._node.onbxdestdragfinish;delete this._node.onbxdragstop;delete this._node.onbxdragrelease;if(BX.type.isFunction(jsDD.unregisterDest)){jsDD.unregisterDest(this._node)}this.doUnbindEvents()},doUnbindEvents:function(){},createPlaceHolder:function(t){throw"BX.UI.BaseDropController: The 'createPlaceHolder' function is not implemented."},removePlaceHolder:function(){throw"BX.UI.BaseDropController: The 'removePlaceHolder' function is not implemented."},initializePlaceHolder:function(t){this.createPlaceHolder(t);this.refresh()},releasePlaceHolder:function(){this.removePlaceHolder();this.refresh()},getPriority:function(){return BX.UI.BaseDropController.defaultPriority},addDragFinishListener:function(t){this.removeDragFinishListener(t);BX.Event.EventEmitter.subscribe("BX.UI.BaseDropController:dragFinish",t)},removeDragFinishListener:function(t){BX.Event.EventEmitter.unsubscribe("BX.UI.BaseDropController:dragFinish",t)},getDraggedItem:function(){return this._draggedItem},setDraggedItem:function(t){if(this._draggedItem===t){return}if(this._draggedItem){this._draggedItem.removeDragListener(this._itemDragHandler)}this._draggedItem=t;if(this._draggedItem){this._draggedItem.addDragListener(this._itemDragHandler)}},isAllowedContext:function(t){return true},isEnabled:function(){return this._enabled},enable:function(t){t=!!t;if(this._enabled===t){return}this._enabled=t;if(t){jsDD.enableDest(this._node)}else{jsDD.disableDest(this._node)}},refresh:function(){jsDD.refreshDestArea(this._node.__bxddeid)},processDragOver:function(t){this.initializePlaceHolder(t)},processDragOut:function(){this.releasePlaceHolder()},processDragStop:function(){this.releasePlaceHolder()},processDragRelease:function(){this.releasePlaceHolder()},processItemDrop:function(){this.releasePlaceHolder()},_onDragOver:function(t,e,r){var o=BX.UI.BaseDragController.currentDragged;if(!o){return}if(!this.isAllowedContext(o.getContextId())){return}this.setDraggedItem(o);this.processDragOver({x:e,y:r})},_onDragOut:function(t,e,r){if(!this._draggedItem){return}this.processDragOut();this.setDraggedItem(null)},_onDragFinish:function(t,e,r){if(!this._draggedItem){return}BX.Event.EventEmitter.emit("BX.UI.BaseDropController:dragFinish",{dropContainer:this,draggedItem:this._draggedItem,x:e,y:r});this.processItemDrop();this.setDraggedItem(null);BX.UI.BaseDropController.refresh()},_onDragRelease:function(t,e,r){if(!this._draggedItem){return}this.processDragRelease();this.setDraggedItem(null)},_onDragStop:function(t,e,r){if(!this._draggedItem){return}this.processDragStop();this.setDraggedItem(null)},_onItemDrag:function(t){if(!this._draggedItem){return}this.initializePlaceHolder({x:t.data["x"],y:t.data["y"]})}};BX.UI.BaseDropController.defaultPriority=100;BX.UI.BaseDropController.refresh=function(){jsDD.refreshDestArea()}}if(typeof BX.UI.EditorDragItem==="undefined"){BX.UI.EditorDragItem=function(){};BX.UI.EditorDragItem.prototype={getType:function(){return BX.UI.EditorDragObjectType.intermediate},getContextId:function(){return""},createGhostNode:function(){return null},processDragStart:function(){},processDragPositionChange:function(t,e){},processDragStop:function(){}}}if(typeof BX.UI.EditorFieldDragItem==="undefined"){BX.UI.EditorFieldDragItem=function(){BX.UI.EditorFieldDragItem.superclass.constructor.apply(this);this._scope=BX.UI.EditorDragScope.undefined;this._control=null;this._contextId=""};BX.extend(BX.UI.EditorFieldDragItem,BX.UI.EditorDragItem);BX.UI.EditorFieldDragItem.prototype.initialize=function(t){this._control=BX.prop.get(t,"control");if(!this._control){throw"UI.EditorFieldDragItem: The 'control' parameter is not defined in settings or empty."}this._scope=BX.prop.getInteger(t,"scope",BX.UI.EditorDragScope.getDefault());this._contextId=BX.prop.getString(t,"contextId","")};BX.UI.EditorFieldDragItem.prototype.getType=function(){return BX.UI.EditorDragObjectType.field};BX.UI.EditorFieldDragItem.prototype.getControl=function(){return this._control};BX.UI.EditorFieldDragItem.prototype.getContextId=function(){return this._contextId!==""?this._contextId:BX.UI.EditorFieldDragItem.contextId};BX.UI.EditorFieldDragItem.prototype.createGhostNode=function(){return this._control.createGhostNode()};BX.UI.EditorFieldDragItem.prototype.processDragStart=function(){window.setTimeout(function(){BX.UI.EditorDragContainerController.enable(BX.UI.EditorFieldDragItem.contextId,true);BX.UI.EditorDragContainerController.enable(BX.UI.EditorSectionDragItem.contextId,false);BX.UI.EditorDragContainerController.refreshAll()});this._control.getWrapper().style.display="none"};BX.UI.EditorFieldDragItem.prototype.processDragPositionChange=function(t,e){var r=this._scope===BX.UI.EditorDragScope.parent?this._control.getParentPosition():this._control.getRootContainerPosition();if(t.y<r.top){t.y=r.top}if(t.y+e.height>r.bottom){t.y=r.bottom-e.height}if(t.x<r.left){t.x=r.left}if(t.x+e.width>r.right){t.x=r.right-e.width}};BX.UI.EditorFieldDragItem.prototype.processDragStop=function(){window.setTimeout(function(){BX.UI.EditorDragContainerController.enable(BX.UI.EditorSectionDragItem.contextId,true);BX.UI.EditorDragContainerController.refreshAll()});this._control.getWrapper().style.display=""};BX.UI.EditorFieldDragItem.contextId="editor_field";BX.UI.EditorFieldDragItem.create=function(t){var e=new BX.UI.EditorFieldDragItem;e.initialize(t);return e}}if(typeof BX.UI.EditorSectionDragItem==="undefined"){BX.UI.EditorSectionDragItem=function(){BX.UI.EditorSectionDragItem.superclass.constructor.apply(this);this._control=null};BX.extend(BX.UI.EditorSectionDragItem,BX.UI.EditorDragItem);BX.UI.EditorSectionDragItem.prototype.initialize=function(t){this._control=BX.prop.get(t,"control");if(!this._control){throw"UI.EditorSectionDragItem: The 'control' parameter is not defined in settings or empty."}};BX.UI.EditorSectionDragItem.prototype.getType=function(){return BX.UI.EditorDragObjectType.section};BX.UI.EditorSectionDragItem.prototype.getControl=function(){return this._control};BX.UI.EditorSectionDragItem.prototype.getContextId=function(){return BX.UI.EditorSectionDragItem.contextId};BX.UI.EditorSectionDragItem.prototype.createGhostNode=function(){return this._control.createGhostNode()};BX.UI.EditorSectionDragItem.prototype.processDragStart=function(){BX.addClass(document.body,"ui-entity-cards-drag");var t=this._control;var e=t.getWrapper().querySelector(".ui-entity-editor-section-content");e.style.height=BX.pos(e).height+"px";BX.addClass(t.getWrapper(),"ui-entity-item-ghost");window.setTimeout(function(){e.style.height=0;e.style.padding=0},0);window.setTimeout(function(){BX.UI.EditorDragContainerController.enable(BX.UI.EditorSectionDragItem.contextId,true);BX.UI.EditorDragContainerController.enable(BX.UI.EditorFieldDragItem.contextId,false);BX.UI.EditorDragContainerController.refreshAll();window.setTimeout(function(){var e=t.getSiblingByIndex(0);if(e!==null&&e!==t){e.getWrapper().scrollIntoView()}},200)})};BX.UI.EditorSectionDragItem.prototype.processDragStop=function(){BX.removeClass(document.body,"ui-entity-cards-drag");window.setTimeout(function(){BX.UI.EditorDragContainerController.enable(BX.UI.EditorFieldDragItem.contextId,true);BX.UI.EditorDragContainerController.refreshAll()});var t=this._control;var e=t.getWrapper().querySelector(".ui-entity-editor-section-content");BX.removeClass(t.getWrapper(),"ui-entity-item-ghost");e.style=""};BX.UI.EditorSectionDragItem.contextId="editor_section";BX.UI.EditorSectionDragItem.create=function(t){var e=new BX.UI.EditorSectionDragItem;e.initialize(t);return e}}if(typeof BX.UI.EditorDragItemController==="undefined"){BX.UI.EditorDragItemController=function(){BX.UI.EditorDragItemController.superclass.constructor.apply(this);this._charge=null;this._preserveDocument=true};BX.extend(BX.UI.EditorDragItemController,BX.UI.BaseDragController);BX.UI.EditorDragItemController.prototype.doInitialize=function(){this._charge=this.getSetting("charge");if(!this._charge){throw"UI.EditorDragItemController: The 'charge' parameter is not defined in settings or empty."}this._ghostOffset={x:0,y:0}};BX.UI.EditorDragItemController.prototype.addStartListener=function(t){BX.Event.EventEmitter.subscribe("BX.UI.EditorDragItemController:dragStart",t)};BX.UI.EditorDragItemController.prototype.removeStartListener=function(t){BX.Event.EventEmitter.unsubscribe("BX.UI.EditorDragItemController:dragStart",t)};BX.UI.EditorDragItemController.prototype.addStopListener=function(t){BX.Event.EventEmitter.subscribe("BX.UI.EditorDragItemController:dragStop",t)};BX.UI.EditorDragItemController.prototype.removeStopListener=function(t){BX.Event.EventEmitter.unsubscribe("BX.UI.EditorDragItemController:dragStop",t)};BX.UI.EditorDragItemController.prototype.getCharge=function(){return this._charge};BX.UI.EditorDragItemController.prototype.createGhostNode=function(){if(this._ghostNode){return this._ghostNode}this._ghostNode=this._charge.createGhostNode();document.body.appendChild(this._ghostNode)};BX.UI.EditorDragItemController.prototype.getGhostNode=function(){return this._ghostNode};BX.UI.EditorDragItemController.prototype.removeGhostNode=function(){if(this._ghostNode){document.body.removeChild(this._ghostNode);this._ghostNode=null}};BX.UI.EditorDragItemController.prototype.getContextId=function(){return this._charge.getContextId()};BX.UI.EditorDragItemController.prototype.getContextData=function(){return{contextId:this._charge.getContextId(),charge:this._charge}};BX.UI.EditorDragItemController.prototype.processDragStart=function(){BX.UI.EditorDragItemController.current=this;this._charge.processDragStart();BX.UI.EditorDragContainerController.refresh(this._charge.getContextId());BX.Event.EventEmitter.emit("BX.UI.EditorDragItemController:dragStart",{})};BX.UI.EditorDragItemController.prototype.processDrag=function(t,e){};BX.UI.EditorDragItemController.prototype.processDragPositionChange=function(t){this._charge.processDragPositionChange(t,BX.pos(this.getGhostNode()))};BX.UI.EditorDragItemController.prototype.processDragStop=function(){BX.UI.EditorDragItemController.current=null;this._charge.processDragStop();BX.UI.EditorDragContainerController.refreshAfter(this._charge.getContextId(),300);BX.Event.EventEmitter.emit("BX.UI.EditorDragItemController:dragStop",{})};BX.UI.EditorDragItemController.current=null;BX.UI.EditorDragItemController.create=function(t,e){var r=new BX.UI.EditorDragItemController;r.initialize(t,e);return r}}if(typeof BX.UI.EditorDragContainer==="undefined"){BX.UI.EditorDragContainer=function(){};BX.UI.EditorDragContainer.prototype={getContextId:function(){return""},getPriority:function(){return 100},hasPlaceHolder:function(){return false},createPlaceHolder:function(t){return null},getPlaceHolder:function(){return null},removePlaceHolder:function(){},getChildNodes:function(){return[]},getChildNodeCount:function(){return 0}}}if(typeof BX.UI.EditorFieldDragContainer==="undefined"){BX.UI.EditorFieldDragContainer=function(){BX.UI.EditorFieldDragContainer.superclass.constructor.apply(this);this._section=null;this._context=""};BX.extend(BX.UI.EditorFieldDragContainer,BX.UI.EditorDragContainer);BX.UI.EditorFieldDragContainer.prototype.initialize=function(t){this._section=BX.prop.get(t,"section");if(!this._section){throw"UI.EditorSectionDragContainer: The 'section' parameter is not defined in settings or empty."}this._context=BX.prop.getString(t,"context","")};BX.UI.EditorFieldDragContainer.prototype.getSection=function(){return this._section};BX.UI.EditorFieldDragContainer.prototype.getContextId=function(){return this._context!==""?this._context:BX.UI.EditorFieldDragItem.contextId};BX.UI.EditorFieldDragContainer.prototype.getPriority=function(){return 10};BX.UI.EditorFieldDragContainer.prototype.hasPlaceHolder=function(){return this._section.hasPlaceHolder()};BX.UI.EditorFieldDragContainer.prototype.createPlaceHolder=function(t){return this._section.createPlaceHolder(t)};BX.UI.EditorFieldDragContainer.prototype.getPlaceHolder=function(){return this._section.getPlaceHolder()};BX.UI.EditorFieldDragContainer.prototype.removePlaceHolder=function(){this._section.removePlaceHolder()};BX.UI.EditorFieldDragContainer.prototype.getChildNodes=function(){var t=[];var e=this._section.getChildren();for(var r=0,o=e.length;r<o;r++){t.push(e[r].getWrapper())}return t};BX.UI.EditorFieldDragContainer.prototype.getChildNodeCount=function(){return this._section.getChildCount()};BX.UI.EditorFieldDragContainer.create=function(t){var e=new BX.UI.EditorFieldDragContainer;e.initialize(t);return e}}if(typeof BX.UI.EditorSectionDragContainer==="undefined"){BX.UI.EditorSectionDragContainer=function(){BX.UI.EditorSectionDragContainer.superclass.constructor.apply(this);this._column=null};BX.extend(BX.UI.EditorSectionDragContainer,BX.UI.EditorDragContainer);BX.UI.EditorSectionDragContainer.prototype.initialize=function(t){this._column=BX.prop.get(t,"column");if(!this._column){throw"UI.EditorSectionDragContainer: The 'column' parameter is not defined in settings or empty."}};BX.UI.EditorSectionDragContainer.prototype.getColumn=function(){return this._column};BX.UI.EditorSectionDragContainer.prototype.getEditor=function(){return this.getColumn().getParent()};BX.UI.EditorSectionDragContainer.prototype.getContextId=function(){return BX.UI.EditorSectionDragItem.contextId};BX.UI.EditorSectionDragContainer.prototype.getPriority=function(){return 20};BX.UI.EditorSectionDragContainer.prototype.hasPlaceHolder=function(){return this._column.hasPlaceHolder()};BX.UI.EditorSectionDragContainer.prototype.createPlaceHolder=function(t){return this._column.createPlaceHolder(t)};BX.UI.EditorSectionDragContainer.prototype.getPlaceHolder=function(){return this._column.getPlaceHolder()};BX.UI.EditorSectionDragContainer.prototype.removePlaceHolder=function(){this._column.removePlaceHolder()};BX.UI.EditorSectionDragContainer.prototype.getChildNodes=function(){var t=[];var e=this._column.getChildren();for(var r=0,o=e.length;r<o;r++){t.push(e[r].getWrapper())}return t};BX.UI.EditorSectionDragContainer.prototype.getChildNodeCount=function(){return this._column.getControlCount()};BX.UI.EditorSectionDragContainer.create=function(t){var e=new BX.UI.EditorSectionDragContainer;e.initialize(t);return e}}if(typeof BX.UI.EditorDragContainerController==="undefined"){BX.UI.EditorDragContainerController=function(){BX.UI.EditorDragContainerController.superclass.constructor.apply(this);this._charge=null};BX.extend(BX.UI.EditorDragContainerController,BX.UI.BaseDropController);BX.UI.EditorDragContainerController.prototype.doInitialize=function(){this._charge=this.getSetting("charge");if(!this._charge){throw"UI.EditorDragContainerController: The 'charge' parameter is not defined in settings or empty."}};BX.UI.EditorDragContainerController.prototype.getCharge=function(){return this._charge};BX.UI.EditorDragContainerController.prototype.createPlaceHolder=function(t){var e=BX.pos(BX.UI.EditorDragItemController.current.getGhostNode());var r=e.top,o=e.top+40;var i=Math.floor((r+o)/2);var n,s;var a=this._charge.getPlaceHolder();if(a){n=a.getPosition();s=Math.floor((n.top+n.bottom)/2);if(r<=n.bottom&&r>=n.top||o>=n.top&&o<=n.bottom||Math.abs(i-s)<=8){if(!a.isActive()){a.setActive(true)}return}}var d=this._charge.getChildNodes();for(var l=0;l<d.length;l++){n=BX.pos(d[l]);s=Math.floor((n.top+n.bottom)/2);if(r<=n.bottom&&r>=n.top||o>=n.top&&o<=n.bottom||Math.abs(i-s)<=8){this._charge.createPlaceHolder(i-s<=0?l:l+1).setActive(true);return}}this._charge.createPlaceHolder(-1).setActive(true);this.refresh()};BX.UI.EditorDragContainerController.prototype.removePlaceHolder=function(){if(this._charge.hasPlaceHolder()){this._charge.removePlaceHolder();this.refresh()}};BX.UI.EditorDragContainerController.prototype.getContextId=function(){return this._charge.getContextId()};BX.UI.EditorDragContainerController.prototype.getPriority=function(){return this._charge.getPriority()};BX.UI.EditorDragContainerController.prototype.isAllowedContext=function(t){return t===this._charge.getContextId()};BX.UI.EditorDragContainerController.refresh=function(t){for(var e in this.items){if(!this.items.hasOwnProperty(e)){continue}var r=this.items[e];if(r.getContextId()===t){r.refresh()}}};BX.UI.EditorDragContainerController.refreshAfter=function(t,e){e=parseInt(e);if(e>0){window.setTimeout(function(){BX.UI.EditorDragContainerController.refresh(t)},e)}else{this.refresh(t)}};BX.UI.EditorDragContainerController.refreshAll=function(){for(var t in this.items){if(!this.items.hasOwnProperty(t)){continue}this.items[t].refresh()}};BX.UI.EditorDragContainerController.enable=function(t,e){for(var r in this.items){if(!this.items.hasOwnProperty(r)){continue}var o=this.items[r];if(o.getContextId()===t){o.enable(e)}}};BX.UI.EditorDragContainerController.items={};BX.UI.EditorDragContainerController.create=function(t,e){var r=new BX.UI.EditorDragContainerController;r.initialize(t,e);this.items[r.getId()]=r;return r}}if(typeof BX.UI.EditorDragPlaceholder==="undefined"){BX.UI.EditorDragPlaceholder=function(){this._settings=null;this._container=null;this._node=null;this._isDragOver=false;this._isActive=false;this._index=-1;this._timeoutId=null};BX.UI.EditorDragPlaceholder.prototype={initialize:function(t){this._settings=t?t:{};this._container=this.getSetting("container",null);this._isActive=this.getSetting("isActive",false);this._index=parseInt(this.getSetting("index",-1))},getSetting:function(t,e){return this._settings.hasOwnProperty(t)?this._settings[t]:e},getContainer:function(){return this._container},setContainer:function(t){this._container=t},isDragOver:function(){return this._isDragOver},isActive:function(){return this._isActive},setActive:function(t,e){if(this._timeoutId!==null){window.clearTimeout(this._timeoutId);this._timeoutId=null}e=parseInt(e);if(e>0){var r=this;window.setTimeout(function(){if(r._timeoutId===null)return;r._timeoutId=null;r.setActive(t,0)},e);return}t=!!t;if(this._isActive===t){return}this._isActive=t;if(this._node){}},getIndex:function(){return this._index},prepareNode:function(){return null},layout:function(){this._node=this.prepareNode();var t=this.getSetting("anchor",null);if(t){this._container.insertBefore(this._node,t)}else{this._container.appendChild(this._node)}BX.bind(this._node,"dragover",BX.delegate(this._onDragOver,this));BX.bind(this._node,"dragleave",BX.delegate(this._onDragLeave,this))},clearLayout:function(){if(this._node){this._node=BX.remove(this._node)}},getPosition:function(){return BX.pos(this._node)},_onDragOver:function(t){t=t||window.event;this._isDragOver=true;return BX.eventReturnFalse(t)},_onDragLeave:function(t){t=t||window.event;this._isDragOver=false;return BX.eventReturnFalse(t)}}}if(typeof BX.UI.EditorDragFieldPlaceholder==="undefined"){BX.UI.EditorDragFieldPlaceholder=function(){};BX.extend(BX.UI.EditorDragFieldPlaceholder,BX.UI.EditorDragPlaceholder);BX.UI.EditorDragFieldPlaceholder.prototype.prepareNode=function(){return BX.create("div",{attrs:{className:"ui-entity-editor-content-block-place"}})};BX.UI.EditorDragFieldPlaceholder.create=function(t){var e=new BX.UI.EditorDragFieldPlaceholder;e.initialize(t);return e}}if(typeof BX.UI.EditorDragSectionPlaceholder==="undefined"){BX.UI.EditorDragSectionPlaceholder=function(){};BX.extend(BX.UI.EditorDragSectionPlaceholder,BX.UI.EditorDragPlaceholder);BX.UI.EditorDragSectionPlaceholder.prototype.prepareNode=function(){return BX.create("div",{attrs:{className:"ui-entity-editor-section ui-entity-editor-section-place"}})};BX.UI.EditorDragSectionPlaceholder.create=function(t){var e=new BX.UI.EditorDragSectionPlaceholder;e.initialize(t);return e}}
//# sourceMappingURL=drag-drop.map.js